<p>Certainly! Here’s a step-by-step guide to install, configure, and
start Apache Kafka on Windows, assuming you have Zookeeper already
installed and running at <code>localhost:2181</code>:</p>
<ol type="1">
<li><p><strong>Download Kafka</strong>:</p>
<p>Visit the official <a
href="https://kafka.apache.org/downloads">Apache Kafka download page</a>
and select the version you want to install. Download the binary
distribution for Windows.</p></li>
<li><p><strong>Extract the Archive</strong>:</p>
<p>After downloading, extract the downloaded ZIP archive to a location
of your choice using a tool like 7-Zip or the built-in Windows
extraction tool.</p></li>
<li><p><strong>Configure Kafka</strong>:</p>
<p>Navigate to the <code>config</code> directory inside the extracted
Kafka directory. You’ll find a file named
<code>server.properties</code>. Open this file in a text editor like
Notepad.</p>
<p>Modify the following property to point to your Zookeeper
instance:</p>
<pre class="properties"><code>zookeeper.connect=localhost:2181</code></pre>
<p>This configuration tells Kafka to connect to the Zookeeper instance
running at <code>localhost:2181</code>.</p></li>
<li><p><strong>Start Zookeeper</strong>:</p>
<p>If Zookeeper is not already running, start it using the steps you
previously followed.</p></li>
<li><p><strong>Start Kafka</strong>:</p>
<p>Open a Command Prompt and navigate to the Kafka directory. Then run
the following command to start the Kafka broker:</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode cmd"><code class="sourceCode dosbat"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>bin\windows\kafka-server-start.bat config\server.properties</span></code></pre></div>
<p>This will start the Kafka broker using the configurations in
<code>server.properties</code>.</p></li>
<li><p><strong>Create Topics</strong>:</p>
<p>Open a new Command Prompt window (leave the Kafka broker running) and
navigate to the Kafka directory. Run the following command to create a
topic:</p>
<div class="sourceCode" id="cb3"><pre
class="sourceCode cmd"><code class="sourceCode dosbat"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>bin\windows\kafka-topics.bat -<span class="at">-create</span> -<span class="at">-topic</span> my<span class="at">-topic</span> -<span class="at">-bootstrap-server</span> localhost:9092 -<span class="at">-partitions</span> 1 -<span class="at">-replication-factor</span> 1</span></code></pre></div>
<p>This command creates a topic named <code>my-topic</code>.</p></li>
</ol>
<p>Kafka is now installed, configured, and running on your Windows
system, connected to your existing Zookeeper instance at
<code>localhost:2181</code>. You can start producing and consuming
messages using the topic you created.</p>
